<template>
	<view class="player">
		<view class="nav">
			<text class="nav-icon iconfont icon-fanhuijiantou" @click="goBack"></text>
		</view>
		<video-list :vl="videolist" :index="index"></video-list>
	</view>
</template>

<script>
	import VideoList from '../../components/VideoList.vue';
	
	export default {
		data() {
			return {
				videolist: '',
			}
		},
		components: {
			VideoList,
		},
		props: ['index'],
		methods: {
			goBack() {
				uni.navigateBack({
					delta: 1,
				})
			},
			getList() {
				uni.getStorage({
					key: 'videolist',
					success: (res) => {
						this.videolist = res.data;
					}
				})
			}
		},
		mounted() {
			this.getList();
		}
	}
</script>

<style lang="scss">
	.player {
		width: 100%;
		height: 100%;
		position: relative;
		color: #FFFFFF;
		.nav {
			padding-top: 45px;
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 40px;
			line-height: 40px;
			.nav-icon {
				position: absolute;
				left: 20px;
				font-size: 16px;
				z-index: 99;
			}
		}
		.swiper {
			width: 100%;
			height: 100%;
			.video-box {
				width: 100%;
				height: 100%;
				.video {
					width: 100%;
					height: 100%;
				}
			}
		}
	}
</style>
